package com.cloudshadow.platform.server.common.uc.protocol.model;


import com.cloudshadow.platform.server.common.base.model.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;

import javax.persistence.*;
import java.util.Date;

//@JsonInclude(Include.NON_NULL)
@Entity
@Table(name = "user")
@ApiModel
public class UserModel extends BaseModel {
	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@GenericGenerator(name = "idGenerator", strategy = "uuid")
	@GeneratedValue(generator = "idGenerator")
	private String id;

	@Column(name = "login_account")
	@Length(max = 32, message = "登录账号长度不能超过32位")
	@ApiModelProperty(value = "登录账号")
	private String login_account;

	@Column(name = "password")
	private String password;

	@Column(name = "user_name")
	@Length(max = 32, message = "名字长度不能超过32位")
	@ApiModelProperty(value = "用户名")
	private String user_name;

	@Column(name = "open_id")
	@ApiModelProperty(value = "微信OPEN_ID")
	private String open_id;

	@Column(name = "user_role")
	@ApiModelProperty(value = "角色编号")
	private Integer user_role;

	@Column(name = "safe_question")
	@ApiModelProperty(value = "安全问题编号")
	private String safe_question;

	@Column(name = "safe_answer")
	@Length(max = 32, message = "安全答案长度不能超过32位")
	@ApiModelProperty(value = "问题答案")
	private String safe_answer;

	@Column(name = "mobile")
	@ApiModelProperty(value = "手机号")
	private String mobile;

	@Column(name = "avatar")
	@ApiModelProperty(value = "头像")
	private String avatar;

	@Column(name = "invite_user_id")
	@ApiModelProperty(value = "邀请人用户编号")
	private String invite_user_id;

	@Column(name = "invite_code")
	@Length(max = 32, message = "邀请码长度不能超过32位")
	@ApiModelProperty(value = "邀请码")
	private String invite_code;

	@Column(name = "invite_num")
	@ApiModelProperty(value = "邀请人数")
	private Integer invite_num;

	@Column(name = "email")
	@Email(message = "邮箱格式不正确")
	@ApiModelProperty(value = "邮箱")
	private String email;

	@Column(name = "create_time")
	@ApiModelProperty(value = "创建时间")
	private Date create_time;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getLogin_account() {
		return login_account;
	}

	public void setLogin_account(String login_account) {
		this.login_account = login_account;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getUser_name() {
		return user_name;
	}

	public void setUser_name(String user_name) {
		this.user_name = user_name;
	}

	public String getOpen_id() {
		return open_id;
	}

	public void setOpen_id(String open_id) {
		this.open_id = open_id;
	}

	public Integer getUser_role() {
		return user_role;
	}

	public void setUser_role(Integer user_role) {
		this.user_role = user_role;
	}

	public String getSafe_question() {
		return safe_question;
	}

	public void setSafe_question(String safe_question) {
		this.safe_question = safe_question;
	}

	public String getSafe_answer() {
		return safe_answer;
	}

	public void setSafe_answer(String safe_answer) {
		this.safe_answer = safe_answer;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getAvatar() {
		return avatar;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	public String getInvite_user_id() {
		return invite_user_id;
	}

	public void setInvite_user_id(String invite_user_id) {
		this.invite_user_id = invite_user_id;
	}

	public String getInvite_code() {
		return invite_code;
	}

	public void setInvite_code(String invite_code) {
		this.invite_code = invite_code;
	}

	public Integer getInvite_num() {
		return invite_num;
	}

	public void setInvite_num(Integer invite_num) {
		this.invite_num = invite_num;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Date getCreate_time() {
		return create_time;
	}

	public void setCreate_time(Date create_time) {
		this.create_time = create_time;
	}
}
